
#---------------------------------------------------------------------------
# user's config
#---------------------------------------------------------------------------
#TARGET_OS := qnx
TARGET_TOOLS_PREFIX := arm-unknown-nto-qnx6.6.0eabi-
#TARGET_TOOLS_PREFIX := ntoarmv7-





#base common flags(both c and c++)
#DEFAULT_COMMON_FLAGS := -O2 -fno-stack-protector -EL -DNDEBUG -DVARIANT_le -DVARIANT_v7 -DBUILDENV_qss -D_GLIBCXX_USE_NANOSLEEP
DEFAULT_COMMON_FLAGS := -O2 -fstack-protector-all -EL -DNDEBUG -DVARIANT_le -DVARIANT_v7 -DBUILDENV_qss -D_GLIBCXX_USE_NANOSLEEP

#macro for qnx
DEFAULT_COMMON_FLAGS += -D_QNX_SOURCE -Wall  -Wno-parentheses -Wno-psabi -DJSON_SKIP_UNSUPPORTED_COMPILER_CHECK

#process version information
VER_DEFINE_MAK := $(TOPDIR)/version.mak

ifeq ($(VER_DEFINE_MAK), $(wildcard $(VER_DEFINE_MAK)))
include $(VER_DEFINE_MAK)
VER_INFO   := $(VER_INFO)"Company:  $(VER_COMPANY)\n"
VER_INFO   := $(VER_INFO)"Project:  $(VER_PROJECT)\n"
VER_INFO   := $(VER_INFO)"Target:   $(VER_TARGET)\n"
VER_INFO   := $(VER_INFO)"Ver:      $(VER_CODE)\n"
VER_INFO   := $(VER_INFO)"Friendly: $(VER_FRIENDLY)\n"

VER_INFO := "\"$(VER_INFO)\""

DEFAULT_COMMON_FLAGS += -DVER_INFO="$(VER_INFO)" 
endif

THIRDPARTYDIR := $(TOPDIR)/../3rdparty
#the include path of third party library
THIRD_PARTY_INCS := -I$(THIRDPARTYDIR)/jsoncpp/armle-v7/usr/include/jsoncpp \
					-I$(THIRDPARTYDIR)/jsoncpp/armle-v7/usr/include \
					 
#the lib path of third party

LIBPATH += -L$(THIRDPARTYDIR)/jsoncpp/armle-v7/usr/lib

					 
#for the path of qnx libcpp header file(not use standard include path) 
#DEFAULT_COMMON_FLAGS += -I$(QNX_TARGET)/usr/include 
DEFAULT_COMMON_FLAGS += -I$(QNX_TARGET)/usr/include/cpp
DEFAULT_COMMON_FLAGS += -I$(QNX_TARGET)/usr/include/cpp/c
DEFAULT_COMMON_FLAGS += $(THIRD_PARTY_INCS) 


DEFAULT_CXXFLAGS := -std=c++11 -Wl,Wall -Wno-reorder


DEFAULT_LDFLAGS := $(LIBPATH)
